package cn.wolfcode.orderServer.feign;

import cn.wolfcode.orderServer.feign.facback.ProductFeignFallBack;
import cn.wolfcode.productServer.domain.Product;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * name :要调用的服务名称
 * fallback : 当被调服务异常，需要执行兜底
 */
@FeignClient(name = "product-service",fallback = ProductFeignFallBack.class)
public interface ProductFeignApi {
    //与被调用方 controller 要一致
    @RequestMapping("/get")
    Product get(@RequestParam("id") Long id);
}
